// ① 引入
import Vue from 'vue'
import VueRouter from 'vue-router'
import MyGoodsList from '@/views/MyGoodsList.vue'
import MyGoodsSearch from '@/views/MyGoodsSearch.vue'
import MyUserInfo from '@/views/MyUserInfo.vue'

// ② 调用 Vue.use() 去注册这个插件
Vue.use(VueRouter)

// ③ 创建路由实例
const router = new VueRouter({
  routes: [
    {
      path: '/',
      redirect: '/goodslist',
    },
    {
      path: '/goodslist',
      component: MyGoodsList,
    },
    {
      path: '/goodssearch',
      component: MyGoodsSearch,
    },
    {
      path: '/userinfo',
      component: MyUserInfo,
    },
  ],
})
// 对外暴露
export default router
